package com.zed.api.games.event;

import com.zed.api.games.Game;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 游戏事件
 *
 * @author Zed
 */
public abstract class GameEvent implements Serializable {

    @Serial
    private static final long serialVersionUID = -6381585763993163414L;
    private Game game;

    public GameEvent(Game game) {
        this.game = Objects.requireNonNull(game, "\"game\" cannot be null.");
    }

    /**
     * 获取游戏
     *
     * @return {@link Game}
     */
    public Game getGame() {
        return this.game;
    }
}
